from rest_framework.response import Response
from rest_framework.views import APIView

from home.TongYi import get_tools_agent, search_db


# Create your views here.


class AgentToolsAPIView(APIView):
    def post(self, request):
        user_input = request.data.get('user_input')
        ret = get_tools_agent(user_input) or search_db(user_input)

        return Response({'msg': 'ok', 'data': ret})
# 给我推荐一个小米手机
# 2024年国家队篮球队，哪一队获胜